package sctu.edu.java.year2016.team03.zhaoyong.day20160522.chapter6_1;

/**
 * 在项目中创建Number类，判断字符串“mingrikejijavabu”中字符'i'出现了几次，并将结果输出
 * Created by zhaoyong on 2016/5/23.
 */
public class wowo {
    public static void main(String[] args) {
        String s = "mingrikejijavabu";
        int m = 0;
        int num = 0;
        char a = 105;
        for (m = 0; m < 16; m++) {
            char mychar2 = s.charAt(m);
            if (mychar2 == a) {
                num = num + 1;
            }
        }
        System.out.println("i出现的次数为：" + num);
    }
}

